package tx.bj12320.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import tx.bj12320.model.*;
import tx.bj12320.dao.*;
import tx.bj12320.service.*;
import tx.bj12320.vo.query.*;


@Entity
@Table(name = "BJ12320_MEETING")
public class Meeting extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;

	//alias
	public static final String TABLE_ALIAS = "会议";
	public static final String ALIAS_MEETING_ID = "会议ID";
	public static final String ALIAS_MEETING_START_TIME = "会议开始时间";
	public static final String ALIAS_MEETING_END_TIME = "会议结束时间";
	public static final String ALIAS_MEETING_PERSON_NUM = "参会人数";
	public static final String ALIAS_MEETING_PERSONS = "参会人员";
	public static final String ALIAS_MEETING_ADDRESS = "会议地址";
	public static final String ALIAS_MEETING_REQURMENT = "会议需求";
	public static final String ALIAS_DEAL_PERSON = "经办人";
	public static final String ALIAS_CONTACT_PERSON = "联系电话";
	public static final String ALIAS_MEETING_TITLE = "会议议题";
	public static final String ALIAS_MEETING_CONTENT = "会议简要内容";
	public static final String ALIAS_MEETING_REMARK = "备注";

	//date formats
	public static final String FORMAT_MEETING_START_TIME = DATE_TIME_FORMAT;
	public static final String FORMAT_MEETING_END_TIME = DATE_TIME_FORMAT;


	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 会议ID       db_column: MEETING_ID
     */

	private Long meetingId;
    /**
     * 会议开始时间       db_column: MEETING_START_TIME
     */

	private java.util.Date meetingStartTime;
    /**
     * 会议结束时间       db_column: MEETING_END_TIME
     */

	private java.util.Date meetingEndTime;
    /**
     * 参会人数       db_column: MEETING_PERSON_NUM
     */

	private Long meetingPersonNum;
    /**
     * 参会人员       db_column: MEETING_PERSONS
     */
	@Length(max=500)
	private java.lang.String meetingPersons;
    /**
     * 会议地址       db_column: MEETING_ADDRESS
     */
	@Length(max=500)
	private java.lang.String meetingAddress;
    /**
     * 会议需求       db_column: MEETING_REQURMENT
     */
	@Length(max=500)
	private java.lang.String meetingRequrment;
    /**
     * 经办人       db_column: DEAL_PERSON
     */
	@Length(max=500)
	private java.lang.String dealPerson;
    /**
     * 联系电话       db_column: CONTACT_PERSON
     */
	@Length(max=500)
	private java.lang.String contactPerson;
    /**
     * 会议议题       db_column: MEETING_TITLE
     */
	@Length(max=500)
	private java.lang.String meetingTitle;
    /**
     * 会议简要内容       db_column: MEETING_CONTENT
     */
	@Length(max=500)
	private java.lang.String meetingContent;
    /**
     * 备注       db_column: MEETING_REMARK
     */
	@Length(max=500)
	private java.lang.String meetingRemark;
	//columns END


	public Meeting(){
	}

	public Meeting(
		Long meetingId
	){
		this.meetingId = meetingId;
	}



	public void setMeetingId(Long value) {
		this.meetingId = value;
	}

	@Id	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="BJ12320_MEETING_SEQU")
    @SequenceGenerator(name="BJ12320_MEETING_SEQU",allocationSize=1,initialValue=1, sequenceName="BJ12320_MEETING_SEQU")
	@Column(name = "MEETING_ID", unique = true, nullable = false, insertable = true, updatable = true, length = 0)
	public Long getMeetingId() {
		return this.meetingId;
	}

	@Transient
	public String getMeetingStartTimeString() {
		return DateConvertUtils.format(getMeetingStartTime(), FORMAT_MEETING_START_TIME);
	}
	public void setMeetingStartTimeString(String value) {
		setMeetingStartTime(DateConvertUtils.parse(value, FORMAT_MEETING_START_TIME,java.util.Date.class));
	}

	@Column(name = "MEETING_START_TIME", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getMeetingStartTime() {
		return this.meetingStartTime;
	}

	public void setMeetingStartTime(java.util.Date value) {
		this.meetingStartTime = value;
	}

	@Transient
	public String getMeetingEndTimeString() {
		return DateConvertUtils.format(getMeetingEndTime(), FORMAT_MEETING_END_TIME);
	}
	public void setMeetingEndTimeString(String value) {
		setMeetingEndTime(DateConvertUtils.parse(value, FORMAT_MEETING_END_TIME,java.util.Date.class));
	}

	@Column(name = "MEETING_END_TIME", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getMeetingEndTime() {
		return this.meetingEndTime;
	}

	public void setMeetingEndTime(java.util.Date value) {
		this.meetingEndTime = value;
	}

	@Column(name = "MEETING_PERSON_NUM", unique = false, nullable = true, insertable = true, updatable = true, length = 0)
	public Long getMeetingPersonNum() {
		return this.meetingPersonNum;
	}

	public void setMeetingPersonNum(Long value) {
		this.meetingPersonNum = value;
	}

	@Column(name = "MEETING_PERSONS", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getMeetingPersons() {
		return this.meetingPersons;
	}

	public void setMeetingPersons(java.lang.String value) {
		this.meetingPersons = value;
	}

	@Column(name = "MEETING_ADDRESS", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getMeetingAddress() {
		return this.meetingAddress;
	}

	public void setMeetingAddress(java.lang.String value) {
		this.meetingAddress = value;
	}

	@Column(name = "MEETING_REQURMENT", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getMeetingRequrment() {
		return this.meetingRequrment;
	}

	public void setMeetingRequrment(java.lang.String value) {
		this.meetingRequrment = value;
	}

	@Column(name = "DEAL_PERSON", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getDealPerson() {
		return this.dealPerson;
	}

	public void setDealPerson(java.lang.String value) {
		this.dealPerson = value;
	}

	@Column(name = "CONTACT_PERSON", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getContactPerson() {
		return this.contactPerson;
	}

	public void setContactPerson(java.lang.String value) {
		this.contactPerson = value;
	}

	@Column(name = "MEETING_TITLE", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getMeetingTitle() {
		return this.meetingTitle;
	}

	public void setMeetingTitle(java.lang.String value) {
		this.meetingTitle = value;
	}

	@Column(name = "MEETING_CONTENT", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getMeetingContent() {
		return this.meetingContent;
	}

	public void setMeetingContent(java.lang.String value) {
		this.meetingContent = value;
	}

	@Column(name = "MEETING_REMARK", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getMeetingRemark() {
		return this.meetingRemark;
	}

	public void setMeetingRemark(java.lang.String value) {
		this.meetingRemark = value;
	}


	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("MeetingId",getMeetingId())
			.append("MeetingStartTime",getMeetingStartTime())
			.append("MeetingEndTime",getMeetingEndTime())
			.append("MeetingPersonNum",getMeetingPersonNum())
			.append("MeetingPersons",getMeetingPersons())
			.append("MeetingAddress",getMeetingAddress())
			.append("MeetingRequrment",getMeetingRequrment())
			.append("DealPerson",getDealPerson())
			.append("ContactPerson",getContactPerson())
			.append("MeetingTitle",getMeetingTitle())
			.append("MeetingContent",getMeetingContent())
			.append("MeetingRemark",getMeetingRemark())
			.toString();
	}

	public int hashCode() {
		return new HashCodeBuilder()
			.append(getMeetingId())
			.toHashCode();
	}

	public boolean equals(Object obj) {
		if(obj instanceof Meeting == false) return false;
		if(this == obj) return true;
		Meeting other = (Meeting)obj;
		return new EqualsBuilder()
			.append(getMeetingId(),other.getMeetingId())
			.isEquals();
	}
}

